<template>
	<view class="container">
		<view class="uni-list" v-if="list.length > 0">
			<view class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in list" :key="index">
				<image mode="widthFix" :src="item.headImgUrl || '../../../static/images/avatar.png'" class="pic">
				</image>
				<view class="uni-list-cell-db">
					<view class="name">{{item.visitName}}</view>
					<view class="p">{{item.visitTime}}</view>
				</view>
			</view>
		</view>
		<view v-else>
			<u-empty mode="favor" icon="../../../../static/images/comment.png" text="暂无记录" width="320" height="320"
				textSize="24"></u-empty>
		</view>
	</view>
</template>


<script>
	export default {
		data() {
			return {
				list: [],
				windowHeight: 0
			}

		},

		onLoad() {
			let that = this;
			that.getIndexVisit();
		},

		onShow() {

		},

		methods: {

			/**
			 * 获取主页搜索
			 */
			getIndexVisit() {
				let that = this;
				that.$request.get('user/getIndexVisit', {
					userInfoId: that.$store.state.app.uid
				}).then(res => {
					that.list = res.value.list;
				}).catch(err => {
					that.$util.Tips({
						title: err
					})
				})
			}
		}
	}
</script>

<style>
	page {
		background: #F3F3F3;
	}

	.container {
		padding: 20rpx;
	}

	.container .uni-list {
		background: none;
	}

	.container .uni-list-cell {
		background-color: #fff;
		margin-bottom: 20rpx;
		border-radius: 14rpx;
	}

	.container .uni-list image {
		width: 88rpx;
		margin-right: 30rpx;
		height: 88rpx;
		border-radius: 50%;
	}

	.container .name {
		font-weight: bold;
	}

	.container .p {
		font-size: 26rpx;
		color: #9C9C9C;
	}
</style>